Attribute Grammars: a Declarative Functional Language

نویسندگان

  • Didier Parigot
  • Gilles Roussel
  • Etienne Duris
  • Martin Jourdan
چکیده

Although Attribute Grammars were introduced thirty years ago, their lack of expressiveness has resulted in limited use outside the domain of static language processing. In this paper we show that it is possible to extend this expressiveness. We claim that Attribute Grammars can be used to describe computations on structures that are not just trees, but also on abstractions allowing for innnite structures. To gain this expressiveness, we introduce two new notions: scheme productions and conditional productions. The result is a language that is comparable in power to most rst-order functional languages, with a distinctive declarative character. Our extensions deal with a diierent part of the Attribute Grammar formalism than what is used in most works on Attribute Grammars, including global analysis and evaluator generation. Hence, most existing results are directly applicable to our extended Attribute Grammars, including eecient implementation (in our case, using the Fnc-2 system The major contribution of this approach is to restore and re-emphasize the intrinsic power of Attribute Grammars. Furthermore, our extensions call for new studies on applying to functional programming the analysis and implementation techniques developed for Attribute Grammars. Ce travail a et e partiellement nanc e par le projet ESPRIT #5399 \Compare". Les Grammaires Attribu ees : un langage fonctionnel d eclaratif R esum e : Bien que les Attribute Grammars aient et e introduites il y a trente ans, leur manque de pouvoir d'expression les a connn ees dans le domaine du traitement des langages de programmation. Dans cet article, nous montrons qu'il est possible d' etendre cette expressivit e. Nous soutenons que les Attribute Grammars peuvent ^ etre utilis ees pour d ecrire des calculs sur des structures qui ne sont pas uniquement des arbres, mais aussi des formes abstraites permettant de d ecrire des structures innnies. AAn d'atteindre cette expressivit e, nous avons introduit deux nouvelles notions : les sch emas de productions et les productions conditionelles. Nous obtenons ainsi un langage dont le pouvoir d'expression est comparable a celui de la plupart des langages fonctionnels du premier ordre, avec un c^ ot e d eclaratif beaucoup plus marqu e. Nos extensions ne remettent pas en cause les bases du formalisme des Attribute Grammars sur lesquelles reposent la plupart des travaux concernant celles-ci, en particulier l'analyse statique et la g en eration d' eva-luateurs. Ainsi, les r esultats existants peuvent ^ etre appliqu es directement a nos Attribute Grammars eten-dues, …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Debugger for Attribute Grammar Specification Language , Silver

Despite the growth of information technology, it has not provided satisfactory results in certain areas. This is because our current approach has been limited by time consuming processes of software testing and software development.Programming,specially declarative and functional, can improve this methodology by making programmers free from following certain sequence of expression calculation. ...

متن کامل

Modular Natural Language Processing Using Declarative Attribute Grammars

A system based on a general top-down parsing algorithm has been developed which allows language processors to be created as executable specifications of arbitrary attribute grammars. Declarative notation of attribute grammars allows modular construction of executable language definitions. Syntax is defined through general context-free grammar rules, and meaning is defined by associated semantic...

متن کامل

Declarative Term Graph Attribution for Program Generation

We show how the declarative spirit of attribute grammars can be employed to define an attribution mechanism for term graphs, where the non-uniqueness of inherited attributes demands an appropriately generalised treatment. Since term graphs are a useful data structure for symbolic computation systems such as theorem provers or program transformation systems, this mechanism provides a powerful me...

متن کامل

Constructing Programs as Executable Attribute Grammars

Attribute grammars provide a formal yet intuitive notation for specifying the static semantics of programming languages and consequently have been used in various compiler generation systems. Their use, however, need not be limited to this. With a little change in perspective, many programs may be regarded as interpreters and constructed as executable attribute grammars. The major advantage is ...

متن کامل

July 2000 Third Workshop on Attribute Grammars and Their Applications Waga2000 Testing Attribute Grammars

Fundamental notions for testing attribute grammars are developed. Two dimensions are explored. The structural dimension focuses on the context-free grammar part of an attribute grammar, whereas the semantic dimension is concerned with attributes, attribute types, conditions, and computations. In both dimensions, and also for the combination of them, we are interested in coverage notions, test s...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995